GBML manual / Rooms

room_change

Starts a transition to room r, using the CURRENT room’s own transition_on_exit (the room being LEFT chooses it). A no-op if a transition is already running, or r is out of range.

Syntax

room_change(r)

Arguments

NameType
rroom

Returns

Nothing.

Description

Starts a transition to room r. It is the room being left that chooses which of the fifteen transition effects plays (its own transition_on_exit, set in the editor's Room Properties, under Transitions and Values) - not the destination, and not this call. A no-op if a transition is already in progress, or r is out of range, so calling this from a Button Pressed handler cannot ever double-fire mid-transition.

See room_change_ext to also carry an instance across the crossing, place it at a specific position, and pick the transition yourself instead of the room's own default.

Example

room_change(room_doc_arena);

Starts leaving for room_doc_arena. The actual swap - clearing non-persistent instances, running the new room's placed instances and creation code - happens later, at the transition's hidden instant, not the instant this line runs.

On the GBA

The actual swap happens later, at the transition’s hidden instant - not the instant this is called. Renamed from room_goto. See room_change_ext for carrying an instance across the crossing and picking the transition yourself.

See also: room_change_ext